﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Composite.UnityExtensions;
using Microsoft.Practices.Composite.Modularity;
using Scoreboard.Data;
using Scoreboard.Basement;

namespace Scoreboard.Main
{
	public class Bootstrapper : UnityBootstrapper
	{
		protected override IModuleCatalog GetModuleCatalog()
		{
			var moduleCatalog = ModuleCatalog.CreateFromXaml(
				new Uri("ModuleCatalog.xaml", UriKind.Relative));
			return moduleCatalog;
		}

		protected override DependencyObject CreateShell()
		{
			ServiceLocator.Initialize(Container);
			AppSettings.Load();

			var shellViewModel = new ShellViewModel();
			var shell = new Shell(shellViewModel);
			Application.Current.RootVisual = shell;
			PagesService.Instance.RegisterShell(shellViewModel);
			return shell;			
		}
	}
}
